<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="java.text.SimpleDateFormat"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	String id = request.getParameter("id");
%>
  <head>
    <base href="<%=basePath%>"/>
    <title>仓库信息修改</title>
	<meta http-equiv="pragma" content="no-cache"/>
	<meta http-equiv="cache-control" content="no-cache"/>
	<meta http-equiv="expires" content="0"/>    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
	<meta http-equiv="description" content="This is my page"/>
	<script type="text/javascript" src="<%=basePath%>dwr/engine.js"></script>
	<script type="text/javascript" src="<%=basePath%>dwr/util.js"></script>
	<script type="text/javascript" src="<%=basePath%>homepage/js/common.js"></script>
	<script type="text/javascript" src="<%= basePath %>dwr/interface/StorageInfoService.js"></script>
	<link rel="stylesheet" type="text/css" media="all" href="<%= basePath %>sources/css/pop-up.css" />
	<link rel="stylesheet" type="text/css" media="all" href="<%= basePath %>sources/css/general.css" />
	<link rel="stylesheet" type="text/css" media="all" href="<%= basePath %>sources/css/reset.css" />
	<link rel="stylesheet" type="text/css" media="all" href="<%= basePath %>sources/css/table.css" />
	<link rel="stylesheet" type="text/css" media="all" href="<%= basePath %>sources/css/view.css" />
	
	
	
	<script language="javascript" type="text/javascript" src="<%= basePath %>sources/js/WdatePicker.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%= basePath %>sources/js/jquery.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%=basePath%>sources/js/jquery.dataTables.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%=basePath%>sources/js/ColReorder.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%=basePath%>sources/js/ColVis.js"></script>
	<script type="text/javascript" src="<%= basePath %>sources/js/jquery.min.js"></script>
	<script type="text/javascript" src="<%= basePath %>sources/js/flexigrid.js"></script>
	<script type="text/javascript" src="<%= basePath %>sources/js/altMenu.js"></script>
	<script src="<%= basePath %>sources/js/jquery-ui.js"></script>
	<script src="<%= basePath %>sources/js/contextmenu.js" type="text/javascript"></script>
	
	
	
    <script type="text/javascript">
    	var id='<%=id%>';
 		function selInfo(){
 			StorageInfoService.selectInfo2(id,showResult);
 		}
 		
 		function showResult(data){
 			document.getElementById("name").value = data.ssiName;
 			document.getElementById("remark").value = data.remark;
 		}
 		
 		function changeInfo(){
 			var newName = document.getElementById("name").value;
 			var newRemark = document.getElementById("remark").value;
 			StorageInfoService.updateInfo(id,newName,newRemark,showResult2);
 		}
 		
 		function showResult2(data){
 			if(data==false){
 				alert("修改成功");
 				// 刷新父页面
 				window.opener.selectInfo2();
 				// 关闭当前页面
 				window.close();
 				
 				
 			}else{
 				alert("修改失败");
 			}
 		}
	</script>
	</head>
	<body style="overflow-y:scroll;" onload="selInfo()">
        <h2 class="title">仓库信息修改</h2>
		<div class="clear"></div>
		 <hr class="dashed" />
		 <div class="clear"></div>
        <table width="100%" border="0" class="round-table">
            <tr>
                <td class="l-t"></td>
                <td class="m-t"></td>
                <td class="r-t"></td>
            </tr>
            <tr>
                <td class="l-m"></td>
                <td>
                	<table class="input-table">
					  <tr>
					    <td width="30%" class="right">仓库名称：</td>
                        <td width="70%"><div class="input-bg" style="left"><input name="name" type="text" id="name" maxlength="100"/></div></td>                  
					  </tr>
					  <tr>
						<td class="right">备注：</td>
						<td><textarea name="remark" cols="50" rows="4" id="remark"></textarea>
						<font color="red">&nbsp;(长度最大为2000)</font>
						</td>
                      </tr> 
                      <tr>
                            <td colspan="2" class="center">
                                <a class="table-btn" onclick="changeInfo()" id="add">修改
                                <a class="table-btn" onclick="clearAdd()">重置</a>
                                <span style="float:right;position:relative; margin:5px 0 0 18px; color:#F00;"><span style="position:relative; top:3px;"></span>注：*&nbsp;是必填项</span>
                            </td>
                        </tr>
                    </table>
                </td>
                <td class="r-m"></td>
            </tr>
            <tr>
                <td class="l-b"></td>
                <td class="m-b"></td>
                <td class="r-b"></td>
            </tr>
        </table>
  </body>
</html>
